#-*_coding:utf8-*-


import os

port=5000


cmd1=os.popen('netstat -o -n -a | findstr :%s'%port)
info=cmd1.read()
print(info)

if info=='':
	print('未找到端口号为:%s 的对应进程'%port)
else:
	pid=info.split()[4]
	print('进程ID: '+pid)
	cmd2=os.popen('taskkill /F /PID  '+pid)
	print(cmd2.read())